package com.axx.android.subject;

import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.axx.android.R;
import com.axx.android.utils.ImageLoader;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

/**
 * Created by Administrator on 2017/8/4 0004.
 */

public class SubjectHistoryAdapter extends BaseQuickAdapter<SubjectHistory.BeforeSubjectListBean, BaseViewHolder> {
    public SubjectHistoryAdapter(@LayoutRes int layoutResId, @Nullable List<SubjectHistory.BeforeSubjectListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, SubjectHistory.BeforeSubjectListBean item) {
        helper.setText(R.id.tv_title, item.getName());
        helper.setText(R.id.tv_comment_cnt, item.getReply()+"");
        helper.setText(R.id.tv_good_cnt, item.getGood()+"");
        ImageLoader.loadImage(item.getUrl(), (ImageView) helper.getView(R.id.iv_bg), mContext);
    }
}
